Remove --travis from `cargo new`
authorAlex Crichton <alex@alexcrichton.com>
Wed, 14 Jan 2015 03:48:00 +0000 (19:48 -0800)
committerAlex Crichton <alex@alexcrichton.com>
Wed, 14 Jan 2015 03:50:01 +0000 (19:50 -0800)
It's a little odd that Cargo only supports travis right now, and as #517 points
out it probably shouldn't be a top-level flag but rather a general "service
flag". Due to a lack of other services and the ease of adding your own travis
configuration, this commit removes the flag altogether for now. It can always be
added later when we've got some more impetus!

Closes #517
Closes #1115

src/bin/new.rs
src/cargo/ops/cargo_new.rs
src/etc/_cargo
src/etc/cargo.bashcomp.sh
tests/test_cargo_new.rs

index c68ec83de15b0c9a04b75fa787b49897f7b51a94..e4c552643234a504898a02af9efc7a6cb602cb40 100644 (file)
@@ -8,7 +8,6 @@ use cargo::util::{CliResult, CliError};
 struct Options {
     flag_verbose: bool,
     flag_bin: bool,
-    flag_travis: bool,
     arg_path: String,
     flag_vcs: Option<ops::VersionControl>,
 }
@@ -25,7 +24,6 @@ Options:
     --vcs <vcs>         Initialize a new repository for the given version
                         control system (git or hg) or do not initialize any version
                         control at all (none) overriding a global configuration.
-    --travis            Create a .travis.yml file
     --bin               Use a binary instead of a library template
     -v, --verbose       Use verbose output
 ";
@@ -34,11 +32,10 @@ pub fn execute(options: Options, shell: &mut MultiShell) -> CliResult<Option<()>
     debug!("executing; cmd=cargo-new; args={:?}", os::args());
     shell.set_verbose(options.flag_verbose);
 
-    let Options { flag_travis, flag_bin, arg_path, flag_vcs, .. } = options;
+    let Options { flag_bin, arg_path, flag_vcs, .. } = options;
 
     let opts = ops::NewOptions {
         version_control: flag_vcs,
-        travis: flag_travis,
         path: arg_path.as_slice(),
         bin: flag_bin,
     };
index 811e9dd5f2445b0c6a0e7371832a731ad98245e7..26ddad9b3d947924bce06b0128abff4cdd5081e2 100644 (file)
@@ -14,7 +14,6 @@ pub enum VersionControl { Git, Hg, NoVcs }
 
 pub struct NewOptions<'a> {
     pub version_control: Option<VersionControl>,
-    pub travis: bool,
     pub bin: bool,
     pub path: &'a str,
 }
@@ -102,10 +101,6 @@ fn mk(path: &Path, name: &str, opts: &NewOptions) -> CargoResult<()> {
         (None, None, name, None) => name,
     };
 
-    if opts.travis {
-        try!(File::create(&path.join(".travis.yml")).write_str("language: rust\n"));
-    }
-
     try!(File::create(&path.join("Cargo.toml")).write_str(format!(
 r#"[package]
 
index 25fdc03b16b5ee1f699256cc973d333eacc38dc1..11cbadd27f8ed23481b64ee834224d0daf603099 100644 (file)
@@ -125,7 +125,6 @@ case $state in
                     '(-h, --help)'{-h,--help}'[show help message]' \
                     '--hg[initialize new mercurial repo]' \
                     '--no-git[no new git repo]' \
-                    '--travis[create new .travis.yml]' \
                     '(-v, --verbose)'{-v,--verbose}'[use verbose output]' \
                     ;;
 
index cdbd42650269dde45c4fa457c7695c9cbdea1adf..bf1e6894373fe8b2cd72bd68ef65746375c99fe9 100644 (file)
@@ -69,7 +69,7 @@ _cargo() {
             return 0;;
         new)
             COMPREPLY=( $(compgen -W \
-                "--bin --git --help --hg --no-git --travis --verbose" \
+                "--bin --git --help --hg --no-git --verbose" \
                  -- "${cur}") )
             return 0;;
         run)
index 49b995817a8e4bfcabcf420a82a6b48d18c1ee54..9bc5491a9b9da573f33ea88b01b7dbe591b255a4 100644 (file)
@@ -68,20 +68,6 @@ test!(simple_git {
                 execs().with_status(0));
 });
 
-test!(simple_travis {
-    os::setenv("USER", "foo");
-    assert_that(cargo_process("new").arg("foo").arg("--travis"),
-                execs().with_status(0));
-
-    assert_that(&paths::root().join("foo"), existing_dir());
-    assert_that(&paths::root().join("foo/Cargo.toml"), existing_file());
-    assert_that(&paths::root().join("foo/src/lib.rs"), existing_file());
-    assert_that(&paths::root().join("foo/.travis.yml"), existing_file());
-
-    assert_that(cargo_process("build").cwd(paths::root().join("foo")),
-                execs().with_status(0));
-});
-
 test!(no_argument {
     assert_that(cargo_process("new"),
                 execs().with_status(1)